﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpineStretch : MonoBehaviour
{
    public float TargetWidthHeightRatio;

    Vector2 originalLocalScale;
	// Use this for initialization
	void Start ()
    {
        originalLocalScale = transform.localScale;

        float device_width = Screen.width;
        float device_height = Screen.height;

        float deviceRatio = device_width / device_height;

        if (deviceRatio < TargetWidthHeightRatio)
            return;

        transform.localScale = originalLocalScale * deviceRatio / TargetWidthHeightRatio;
    }
	
}
